package com.lemurian.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.lemurian.entity.utils.DefaultPersistence;

@Entity
@Table(name="tb_client_certificate")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@BatchSize(size=100)
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class ClientCertificate extends DefaultPersistence implements Serializable {

	private static final long serialVersionUID = 1L;

	private Date endTypingDate;
	private String revisionNote;

	@ManyToOne()
	@JoinColumn(name="certificate_type_id")
	private Category certificateType;
	
	@ManyToOne()
	@JoinColumn(name="client_id")
	private Client client;

	public Category getCertificateType() {
		return certificateType;
	}

	public void setCertificateType(Category certificateType) {
		this.certificateType = certificateType;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="end_typing_date")
	public Date getEndTypingDate() {
		return endTypingDate;
	}

	public void setEndTypingDate(Date endTypingDate) {
		this.endTypingDate = endTypingDate;
	}

	@Column(name="revision_note", length=512)
	public String getRevisionNote() {
		return revisionNote;
	}

	public void setRevisionNote(String revisionNote) {
		this.revisionNote = revisionNote;
	}

	public Client getClient() {
		return client;
	}

	public void setClient(Client client) {
		this.client = client;
	}
	
}
